package day05;

/**
 * 说明:
 *
 * @author:SuZhongHe
 * @date:2023/2/16
 **/
public class ArrayDemo {
    public static void main(String[] args) {
        int[] arr = new int[10];
        for (int i = 0; i < arr.length; i++) {
            arr[i]=(int) (Math.random()*100);
            System.out.println(arr[i]);
        }















        /*
        int[] a = new int[];
        double[] d = new double[10];
        boolean[] b = new boolean[26];

        int[] arr1 = new int[3];
        int[] arr2 = {2, 5, 8};
        */
        int[] arr4 = new int[]{2, 5, 8};
         int s[]=new int[] {2,3};
        /*
        int[] arr5;
        //arr5={2,5,8};编译错误  此方法值能声明同时初始化
        arr5 = new int[]{2, 5, 8};
        int[] arr = new int[3];
        System.out.println("数组的长度:" + arr.length);
        System.out.println(arr[0]);
        arr[0] = 100;
        arr[1] = 200;
        arr[2] = 300;
        //arr[3]=400;  运行发生下标越界异常;
        System.out.println(arr.length - 1);
         */


    }
}
